Skip to content

Conversation

@lopert
Copy link
Collaborator

@lopert lopert commented Oct 23, 2025

The fixture input validator doesn't currently handle GraphQL abstract types where different items can be different concrete types.

In this PR, when a field is missing from a fixture, we use typeInfo.getParentType() to determine the concrete type, and validate whether that field is actually expected based on the fixture value's __typename.

@lopert lopert marked this pull request as ready for review October 23, 2025 19:15
@lopert lopert requested a review from adampetro October 27, 2025 18:40
@lopert lopert force-pushed the lopert.abstract-types branch from f61f2b1 to d5ba41c Compare October 28, 2025 14:41
@lopert lopert requested a review from adampetro October 28, 2025 14:41
@lopert lopert requested a review from adampetro October 29, 2025 12:32
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are a bunch of new tests with valid outputs, but should we have more with errors to know that we're properly validating and not accidentally skipping validating objects?

@adampetro adampetro self-requested a review October 29, 2025 20:38
@adampetro
Copy link
Contributor

(oops, accidentally hit approve when I meant to comment)

@lopert lopert requested a review from adampetro October 30, 2025 19:21
@lopert lopert force-pushed the lopert.abstract-types branch from 6e2bb1c to 84542dd Compare October 30, 2025 19:45
Copy link
Contributor

@saga-dasgupta saga-dasgupta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was able to run through the code and have it make sense with one of the example query and fixture that utilized union 👍🏻

@lopert lopert merged commit 398059d into main Oct 31, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants